Learn R Programming

adegenet (version 2.0.0)

as methods in adegenet: Converting genind/genpop objects to other classes

Description

These S3 and S4 methods are used to coerce genind and genpop objects to matrix-like objects. In most cases, this is equivalent to calling the @tab slot. An exception to this is the convertion to ktab objects used in the ade4 package as inputs for K-tables methods (e.g. Multiple Coinertia Analysis).

Arguments

Usage

as(object, Class)

Examples

Run this code
data(microbov)
x <- tab(microbov,NA.method="mean")
as(x[1:3],"data.frame")

## dudi functions attempt to convert their first argument
## to a data.frame; so they can be used on genind/genpop objects.
## perform a PCA
pca1 <- dudi.pca(x, scale=FALSE, scannf=FALSE)
pca1

x <- genind2genpop(microbov,miss="chi2")
x <- as(x,"ktab")
class(x)
## perform a STATIS analysis
statis1 <- statis(x, scannf=FALSE)
statis1
plot(statis1)

Run the code above in your browser using DataLab